From 11f3b7730c278c1d58335896441c285091b5b740 Mon Sep 17 00:00:00 2001 From: Alexander Mikhaylenko Date: Fri, 25 Dec 2020 22:58:06 +0500 Subject: [PATCH] windowhandle: Use drag threshold instead of double click threshold Now that we have gtk_drag_check_threshold_double(), be consistent with other draggable widgets and make sure we don't take over a drag before a child does. Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3513 --- gtk/gtkwindowhandle.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/gtk/gtkwindowhandle.c b/gtk/gtkwindowhandle.c index f4f2fa6e49..a4265df7c7 100644 --- a/gtk/gtkwindowhandle.c +++ b/gtk/gtkwindowhandle.c @@ -24,6 +24,7 @@ #include "gtkbinlayout.h" #include "gtkbox.h" #include "gtkbuildable.h" +#include "gtkdragsourceprivate.h" #include "gtkgestureclick.h" #include "gtkgesturedrag.h" #include "gtkgestureprivate.h" @@ -388,16 +389,7 @@ drag_gesture_update_cb (GtkGestureDrag *gesture, double offset_y, GtkWindowHandle *self) { - int double_click_distance; - GtkSettings *settings; - - settings = gtk_widget_get_settings (GTK_WIDGET (self)); - g_object_get (settings, - "gtk-double-click-distance", &double_click_distance, - NULL); - - if (ABS (offset_x) > double_click_distance || - ABS (offset_y) > double_click_distance) + if (gtk_drag_check_threshold_double (GTK_WIDGET (self), 0, 0, offset_x, offset_y)) { double start_x, start_y; double native_x, native_y; -- 2.30.2